package com.ww.flink

import org.apache.flink.api.common.functions.ReduceFunction
import org.apache.flink.api.common.serialization.SimpleStringSchema
import org.apache.flink.streaming.api.scala.{StreamExecutionEnvironment, _}
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer
import org.apache.kafka.common.serialization.StringSerializer

import java.util.Properties

//统计卡口流量
object Flink_try06_split {
  def main(args: Array[String]): Unit = {
    val env = StreamExecutionEnvironment.getExecutionEnvironment
    val stream = env.generateSequence(1,100)
    val splitStream = stream.split(
      d => {
        d % 2 match {
          case 0 => List("even")
          case 1 => List("odd")
        }
      }
    )
    splitStream.select("even").print("xxx")
    env.execute()

  }
}
